import React, { PureComponent } from 'react';
import moment from 'moment';
import { Card } from 'antd';
import DescriptionList from '@/components/DescriptionList';

const { Description } = DescriptionList;
class EmpInfor extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      laborInfo: {},
    };
  }

  componentDidMount() {}

  jumpRouting = targetRouter => {
    const { jumpRouting } = this.props;
    jumpRouting(targetRouter);
  };

  render() {
    const { laborInfo } = this.state;
    return (
      <div>
        <Card
          style={{ marginBottom: 12 }}
          title={<span style={{ fontWeight: 'bolder' }}>劳动合同信息</span>}
          bordered={false}
          extra={
            <a onClick={() => this.jumpRouting('laborContId', laborInfo.laborContId)}>
              详情&gt;&gt;
            </a>
          }
          id="laborcontractinfor"
        >
          <DescriptionList>
            <Description term="客户名称">{laborInfo.custName || '--'}</Description>
            <Description term="合同编号">{laborInfo.constNo || '--'}</Description>
            <Description term="合同开始日期">
              {laborInfo.contBeginDate
                ? moment(laborInfo.contBeginDate).format('YYYY-MM-DD')
                : null}
            </Description>
            <Description term="合同结束日期">
              {laborInfo.contEndDate ? moment(laborInfo.contEndDate).format('YYYY-MM-DD') : null}
            </Description>
            <Description term="合同状态">{laborInfo.contStateName || '--'}</Description>
            <Description term="签订类型">{laborInfo.signType || '--'}</Description>
            <Description term="签署方式">
              {laborInfo.signWayName ? laborInfo.signWayName : '--'}
            </Description>
            <Description term="签订日期">
              {laborInfo.signDate ? moment(laborInfo.signDate).format('YYYY-MM-DD HH:mm:ss') : '--'}
            </Description>
          </DescriptionList>
        </Card>
      </div>
    );
  }
}

export default EmpInfor;
